<?php

use think\facade\Route;
use app\admin\middleware\LoginMiddleware;
use app\admin\middleware\AuthMiddleware;
use app\admin\middleware\OperationLog;

Route::group('user', function () {

    Route::group('user', function () {
        //用户列表
        Route::get('lists', 'user.User/lists');
        //添加用户
        Route::post('add', 'user.User/add');
        //编辑用户
        Route::post('edit', 'user.User/edit');
        //用户详情
        Route::get('detail', 'user.User/detail');
        //用户token信息
        Route::get('token', 'user.User/token');
        //删除token
        Route::post('deleteToken', 'user.User/deleteToken');
        //更改用户状态
        Route::post('updateStatus', 'user.User/updateStatus');
        //导出
        Route::post('export', 'user.User/export');
    });

    Route::group('group', function () {
        //用户分组列表
        Route::get('lists', 'user.Group/lists');
        //添加用户分组
        Route::post('add', 'user.Group/add');
        //编辑用户分组
        Route::post('edit', 'user.Group/edit');
        //用户分组详情
        Route::get('detail', 'user.Group/detail');
        //删除用户分组
        Route::delete('delete', 'user.Group/delete');
        //获取用户分组
        Route::get('all', 'user.Group/all');
    });

    Route::group('visit', function () {
        //用户浏览日志列表
        Route::get('lists', 'user.VisitLog/lists');
        //用户浏览日志详情
        Route::get('detail', 'user.VisitLog/detail');
    });

})->middleware([
    LoginMiddleware::class,
    AuthMiddleware::class,
    OperationLog::class
]);